﻿using System;
using System.Collections.Generic;

namespace Pixels.Interface
{
    public class Label : InterfaceElement
    {
        public override void render() {
            if (!Visible) return;

            var text = Render.textInBox(ShownString, this.ScreenRect, true);
            text.horizontalAlign = this.horizontalAlign;
            text.verticalAlign   = this.verticalAlign;
            text.color = this.color;
            text.alpha = this.alpha;
            text.characterSize = this.characterSize;
            text.zed = zed;
        }
        
        string ShownString { get { return this.myString; } } // edit later if you want cursor effects
        string myString;

        uint characterSize = 22;

        public Sargon.Color color = Sargon.Color.white;
        public float alpha = 1f;

        public Sargon.Text.VAlign verticalAlign;
        public Sargon.Text.HAlign horizontalAlign;

        public Label(string shownString, int x, int y, int w, int h) {
            this.myString = shownString;
            this.localPosition = new Ur.Rect(x, y, w, h);
        }

        public override void input(Sargon.InputState state) {
            // do nothing            
        }

        public override void tick() {
            
        }
    }
}
